﻿namespace Z2.Editor
{

	using System;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Data;
	using System.Drawing;
	using System.Text;
	using System.Windows.Forms;

	public partial class ObjectProperties : Form
	{

		private EditorFieldObject m_object;

		public ObjectProperties(EditorFieldObject obj)
		{
			this.InitializeComponent();

			this.m_object = obj;
			this.cbObjectType.SelectedIndex = (int)this.m_object.Type;
			this.nuBend.Value = this.m_object.Bend;
		}

		private void cbObjectType_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.nuBend.Enabled = this.cbObjectType.SelectedIndex == 2;
		}

		private void btOK_Click(object sender, EventArgs e)
		{
			this.m_object.Type = (FieldObjectType)this.cbObjectType.SelectedIndex;
			this.m_object.Bend = (int)this.nuBend.Value;
			this.DialogResult = DialogResult.OK;
		}
	}
}
